package test_range

import "fmt"

func DoRange() {
	fmt.Println("Range")

	nums := []int{2, 3, 4}
	sum := 0

	for _, v := range nums {
		sum += v
	}

	fmt.Println(sum)

	kvs := map[string]int{"a": 1, "b": 2}
	for k, v := range kvs {
		fmt.Println(k, v)
	}

	str := "go"
	for i, c := range str {
		fmt.Println(i, c)
	}
}
